package com.vhall.component.controller.interactive;

import com.vhall.component.controller.interactive.facade.DocumentAdminFacade;
import com.vhall.component.entity.interactive.vo.*;
import com.vhall.component.framework.common.annotation.VhallComponent;
import com.vhall.component.plugin.common.annotation.TokenAuth;
import com.vhall.component.plugin.common.enums.OperateTypeEnum;
import com.vhall.component.service.annotation.OperateLog;
import com.vhall.component.service.interactive.DocumentsAdminService;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author song.dong
 * @date 2021-07-29 18:35
 */
@Tag(name = "文档列表-管理端")
@VhallComponent
public class DocumentAdminController implements DocumentAdminFacade {

    @Autowired
    private DocumentsAdminService adminService;

    /**
     * 控制台文档上传
     *
     * @param reqVO
     * @return
     */
    @Override
    @OperateLog(type = OperateTypeEnum.IMPORT, name = "文档上传")
    public Boolean consoleUpload(DocumentConsoleUploadReqVO reqVO) {
        return null;
    }

    /**
     * 控制台文档删除
     *
     * @param reqVO
     * @return
     */
    @Override
    @TokenAuth("sys:document:del")
    @OperateLog(type = OperateTypeEnum.DELETE, name = "文档删除")
    public DocumentDeleteRespVO delete(DocumentConsoleDeleteReqVO reqVO) {
        return adminService.delete(reqVO);
    }

    /**
     * 控制台文档列表
     *
     * @param reqVO
     * @return
     */
    @Override
    @TokenAuth("sys:document:list")
    public DocumentAdminListRspVO list(DocumentAdminListReqVO reqVO) {
        return adminService.list(reqVO);
    }
}
